<template>
    <div class="container">
        <div class="card">
            <el-breadcrumb separator="/" class="card-body">
                <el-breadcrumb-item :to="{ path: '/AdminHome' }"><i class="el-icon-location"></i>首页</el-breadcrumb-item>
                <el-breadcrumb-item :to="{ path: '/SystemSetting/Supplier' }">供应商管理</el-breadcrumb-item>
                <el-breadcrumb-item>{{ this.$route.meta.title }}</el-breadcrumb-item>
            </el-breadcrumb>
        </div>
        <div class="card">
            <div class="card-header">供应商详情</div>
            <div class="card-body">
                <el-form ref="form" :model="form" label-width="120px">
                <div class="info-ruleForm">
                    <el-form-item label="供应商编号" prop="code">
                        <el-input v-model="form.code" maxlength="0"></el-input>
                    </el-form-item>
                    <el-form-item label="公司名称" prop="name">
                        <el-input v-model="form.name" maxlength="0"></el-input>
                    </el-form-item>
                    <el-form-item label="业务描述" prop="businessDesc">
                        <el-input type="textarea" v-model="form.businessDesc" maxlength="0"></el-input>
                    </el-form-item>
                    <el-form-item label="供应商地址" prop="address">
                        <el-input v-model="form.address" maxlength="0"></el-input>
                    </el-form-item>
                    <el-form-item label="联系人" prop="contactName">
                        <el-input v-model="form.contactName" maxlength="0"></el-input>
                    </el-form-item>       
                    <el-form-item label="联系电话" prop="contactMobile">
                        <el-input v-model="form.contactMobile" maxlength="0"></el-input>
                    </el-form-item>      
                    <el-form-item label="联系邮箱" prop="contactEmail">
                        <el-input v-model="form.contactEmail" maxlength="0"></el-input>
                    </el-form-item>   
                    <el-form-item label="备注">
                        <el-input type="textarea" maxlength="0" v-model="form.remark"></el-input>
                    </el-form-item>   
                </div>
                <hr>
                <el-form-item>
                    <el-button @click="goBack">返回上一级</el-button>
                </el-form-item>
                </el-form>
            </div>
        </div>
    </div>
</template>

<script>
import request from "@/utils/request";
export default {
  name: "SupplierDetail",
  data() {
    return {
      form: {
        address: "",
        businessDesc: "",
        code: "",
        contactEmail: "",
        contactMobile: "",
        contactName: "",
        name: "",
        remark: ""
      }
    };
  },
  methods: {
    goBack() {
      this.$router.go(-1);
    },
    getSupplierDetail() {
      request({
        method: "get",
        url: this.$api.getSupplierDetail + `?id=${this.$route.query.id}`
      }).then(res => {
        console.log(res);
        this.form = res.data;
      });
    }
  },
  mounted() {
    this.getSupplierDetail();
  }
};
</script>

<style scoped>
</style>